package com.fly.r2dbc.basics.dao;

import org.springframework.data.domain.Pageable;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;

import com.fly.r2dbc.basics.entity.Customer;

import reactor.core.publisher.Flux;

/**
 * @author Oliver Gierke
 * @author Mark Paluch
 */
public interface CustomerRepository extends ReactiveCrudRepository<Customer, Long>
{
    @Query("select id, firstname, lastname from customer c where c.lastname = :lastname")
    Flux<Customer> findByLastname(String lastname);
    
    Flux<Customer> findById(Integer id);
    
    Flux<Customer> findBy(Pageable pageable);
}
